Optimal. Leaf size=83 \[ \frac {\log (\cosh (c+d x))}{(a+b)^2 d}-\frac {a (a+2 b) \log \left (a+b \tanh ^2(c+d x)\right )}{2 b^2 (a+b)^2 d}-\frac {a^2}{2 b^2 (a+b) d \left (a+b \tanh ^2(c+d x)\right )} \]
[Out]
________________________________________________________________________________________
Rubi [A]
time = 0.11, antiderivative size = 83, normalized size of antiderivative = 1.00, number of steps
used = 4, number of rules used = 3, integrand size = 23, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.130, Rules used = {3751, 457, 90}
\begin {gather*} -\frac {a^2}{2 b^2 d (a+b) \left (a+b \tanh ^2(c+d x)\right )}-\frac {a (a+2 b) \log \left (a+b \tanh ^2(c+d x)\right )}{2 b^2 d (a+b)^2}+\frac {\log (\cosh (c+d x))}{d (a+b)^2} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
Rule 90
Rule 457
Rule 3751
Rubi steps
\begin {align*} \int \frac {\tanh ^5(c+d x)}{\left (a+b \tanh ^2(c+d x)\right )^2} \, dx &=\frac {\text {Subst}\left (\int \frac {x^5}{\left (1-x^2\right ) \left (a+b x^2\right )^2} \, dx,x,\tanh (c+d x)\right )}{d}\\ &=\frac {\text {Subst}\left (\int \frac {x^2}{(1-x) (a+b x)^2} \, dx,x,\tanh ^2(c+d x)\right )}{2 d}\\ &=\frac {\text {Subst}\left (\int \left (-\frac {1}{(a+b)^2 (-1+x)}+\frac {a^2}{b (a+b) (a+b x)^2}-\frac {a (a+2 b)}{b (a+b)^2 (a+b x)}\right ) \, dx,x,\tanh ^2(c+d x)\right )}{2 d}\\ &=\frac {\log (\cosh (c+d x))}{(a+b)^2 d}-\frac {a (a+2 b) \log \left (a+b \tanh ^2(c+d x)\right )}{2 b^2 (a+b)^2 d}-\frac {a^2}{2 b^2 (a+b) d \left (a+b \tanh ^2(c+d x)\right )}\\ \end {align*}
________________________________________________________________________________________
Mathematica [A]
time = 0.38, size = 69, normalized size = 0.83 \begin {gather*} -\frac {-2 \log (\cosh (c+d x))+\frac {a (a+2 b) \log \left (a+b \tanh ^2(c+d x)\right )}{b^2}+\frac {a^2 (a+b)}{b^2 \left (a+b \tanh ^2(c+d x)\right )}}{2 (a+b)^2 d} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [A]
time = 0.73, size = 91, normalized size = 1.10
method | result | size |
derivativedivides | \(\frac {-\frac {a \left (\frac {\left (a +b \right ) a}{b^{2} \left (a +b \left (\tanh ^{2}\left (d x +c \right )\right )\right )}+\frac {\left (2 b +a \right ) \ln \left (a +b \left (\tanh ^{2}\left (d x +c \right )\right )\right )}{b^{2}}\right )}{2 \left (a +b \right )^{2}}-\frac {\ln \left (\tanh \left (d x +c \right )-1\right )}{2 \left (a +b \right )^{2}}-\frac {\ln \left (1+\tanh \left (d x +c \right )\right )}{2 \left (a +b \right )^{2}}}{d}\) | \(91\) |
default | \(\frac {-\frac {a \left (\frac {\left (a +b \right ) a}{b^{2} \left (a +b \left (\tanh ^{2}\left (d x +c \right )\right )\right )}+\frac {\left (2 b +a \right ) \ln \left (a +b \left (\tanh ^{2}\left (d x +c \right )\right )\right )}{b^{2}}\right )}{2 \left (a +b \right )^{2}}-\frac {\ln \left (\tanh \left (d x +c \right )-1\right )}{2 \left (a +b \right )^{2}}-\frac {\ln \left (1+\tanh \left (d x +c \right )\right )}{2 \left (a +b \right )^{2}}}{d}\) | \(91\) |
risch | \(\frac {x}{a^{2}+2 a b +b^{2}}-\frac {2 x}{b^{2}}-\frac {2 c}{b^{2} d}+\frac {4 a x}{b \left (a^{2}+2 a b +b^{2}\right )}+\frac {4 a c}{b d \left (a^{2}+2 a b +b^{2}\right )}+\frac {2 a^{2} x}{b^{2} \left (a^{2}+2 a b +b^{2}\right )}+\frac {2 a^{2} c}{b^{2} d \left (a^{2}+2 a b +b^{2}\right )}-\frac {2 a^{2} {\mathrm e}^{2 d x +2 c}}{b d \left (a +b \right )^{2} \left (a \,{\mathrm e}^{4 d x +4 c}+b \,{\mathrm e}^{4 d x +4 c}+2 a \,{\mathrm e}^{2 d x +2 c}-2 b \,{\mathrm e}^{2 d x +2 c}+a +b \right )}+\frac {\ln \left (1+{\mathrm e}^{2 d x +2 c}\right )}{b^{2} d}-\frac {a \ln \left ({\mathrm e}^{4 d x +4 c}+\frac {2 \left (a -b \right ) {\mathrm e}^{2 d x +2 c}}{a +b}+1\right )}{b d \left (a^{2}+2 a b +b^{2}\right )}-\frac {a^{2} \ln \left ({\mathrm e}^{4 d x +4 c}+\frac {2 \left (a -b \right ) {\mathrm e}^{2 d x +2 c}}{a +b}+1\right )}{2 b^{2} d \left (a^{2}+2 a b +b^{2}\right )}\) | \(329\) |
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [B] Leaf count of result is larger than twice the leaf count of optimal. 217 vs.
\(2 (79) = 158\).
time = 0.52, size = 217, normalized size = 2.61 \begin {gather*} -\frac {2 \, a^{2} e^{\left (-2 \, d x - 2 \, c\right )}}{{\left (a^{3} b + 3 \, a^{2} b^{2} + 3 \, a b^{3} + b^{4} + 2 \, {\left (a^{3} b + a^{2} b^{2} - a b^{3} - b^{4}\right )} e^{\left (-2 \, d x - 2 \, c\right )} + {\left (a^{3} b + 3 \, a^{2} b^{2} + 3 \, a b^{3} + b^{4}\right )} e^{\left (-4 \, d x - 4 \, c\right )}\right )} d} - \frac {{\left (a^{2} + 2 \, a b\right )} \log \left (2 \, {\left (a - b\right )} e^{\left (-2 \, d x - 2 \, c\right )} + {\left (a + b\right )} e^{\left (-4 \, d x - 4 \, c\right )} + a + b\right )}{2 \, {\left (a^{2} b^{2} + 2 \, a b^{3} + b^{4}\right )} d} + \frac {d x + c}{{\left (a^{2} + 2 \, a b + b^{2}\right )} d} + \frac {\log \left (e^{\left (-2 \, d x - 2 \, c\right )} + 1\right )}{b^{2} d} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [B] Leaf count of result is larger than twice the leaf count of optimal. 1141 vs.
\(2 (79) = 158\).
time = 0.46, size = 1141, normalized size = 13.75 \begin {gather*} -\frac {2 \, {\left (a b^{2} + b^{3}\right )} d x \cosh \left (d x + c\right )^{4} + 8 \, {\left (a b^{2} + b^{3}\right )} d x \cosh \left (d x + c\right ) \sinh \left (d x + c\right )^{3} + 2 \, {\left (a b^{2} + b^{3}\right )} d x \sinh \left (d x + c\right )^{4} + 2 \, {\left (a b^{2} + b^{3}\right )} d x + 4 \, {\left (a^{2} b + {\left (a b^{2} - b^{3}\right )} d x\right )} \cosh \left (d x + c\right )^{2} + 4 \, {\left (3 \, {\left (a b^{2} + b^{3}\right )} d x \cosh \left (d x + c\right )^{2} + a^{2} b + {\left (a b^{2} - b^{3}\right )} d x\right )} \sinh \left (d x + c\right )^{2} + {\left ({\left (a^{3} + 3 \, a^{2} b + 2 \, a b^{2}\right )} \cosh \left (d x + c\right )^{4} + 4 \, {\left (a^{3} + 3 \, a^{2} b + 2 \, a b^{2}\right )} \cosh \left (d x + c\right ) \sinh \left (d x + c\right )^{3} + {\left (a^{3} + 3 \, a^{2} b + 2 \, a b^{2}\right )} \sinh \left (d x + c\right )^{4} + a^{3} + 3 \, a^{2} b + 2 \, a b^{2} + 2 \, {\left (a^{3} + a^{2} b - 2 \, a b^{2}\right )} \cosh \left (d x + c\right )^{2} + 2 \, {\left (a^{3} + a^{2} b - 2 \, a b^{2} + 3 \, {\left (a^{3} + 3 \, a^{2} b + 2 \, a b^{2}\right )} \cosh \left (d x + c\right )^{2}\right )} \sinh \left (d x + c\right )^{2} + 4 \, {\left ({\left (a^{3} + 3 \, a^{2} b + 2 \, a b^{2}\right )} \cosh \left (d x + c\right )^{3} + {\left (a^{3} + a^{2} b - 2 \, a b^{2}\right )} \cosh \left (d x + c\right )\right )} \sinh \left (d x + c\right )\right )} \log \left (\frac {2 \, {\left ({\left (a + b\right )} \cosh \left (d x + c\right )^{2} + {\left (a + b\right )} \sinh \left (d x + c\right )^{2} + a - b\right )}}{\cosh \left (d x + c\right )^{2} - 2 \, \cosh \left (d x + c\right ) \sinh \left (d x + c\right ) + \sinh \left (d x + c\right )^{2}}\right ) - 2 \, {\left ({\left (a^{3} + 3 \, a^{2} b + 3 \, a b^{2} + b^{3}\right )} \cosh \left (d x + c\right )^{4} + 4 \, {\left (a^{3} + 3 \, a^{2} b + 3 \, a b^{2} + b^{3}\right )} \cosh \left (d x + c\right ) \sinh \left (d x + c\right )^{3} + {\left (a^{3} + 3 \, a^{2} b + 3 \, a b^{2} + b^{3}\right )} \sinh \left (d x + c\right )^{4} + a^{3} + 3 \, a^{2} b + 3 \, a b^{2} + b^{3} + 2 \, {\left (a^{3} + a^{2} b - a b^{2} - b^{3}\right )} \cosh \left (d x + c\right )^{2} + 2 \, {\left (a^{3} + a^{2} b - a b^{2} - b^{3} + 3 \, {\left (a^{3} + 3 \, a^{2} b + 3 \, a b^{2} + b^{3}\right )} \cosh \left (d x + c\right )^{2}\right )} \sinh \left (d x + c\right )^{2} + 4 \, {\left ({\left (a^{3} + 3 \, a^{2} b + 3 \, a b^{2} + b^{3}\right )} \cosh \left (d x + c\right )^{3} + {\left (a^{3} + a^{2} b - a b^{2} - b^{3}\right )} \cosh \left (d x + c\right )\right )} \sinh \left (d x + c\right )\right )} \log \left (\frac {2 \, \cosh \left (d x + c\right )}{\cosh \left (d x + c\right ) - \sinh \left (d x + c\right )}\right ) + 8 \, {\left ({\left (a b^{2} + b^{3}\right )} d x \cosh \left (d x + c\right )^{3} + {\left (a^{2} b + {\left (a b^{2} - b^{3}\right )} d x\right )} \cosh \left (d x + c\right )\right )} \sinh \left (d x + c\right )}{2 \, {\left ({\left (a^{3} b^{2} + 3 \, a^{2} b^{3} + 3 \, a b^{4} + b^{5}\right )} d \cosh \left (d x + c\right )^{4} + 4 \, {\left (a^{3} b^{2} + 3 \, a^{2} b^{3} + 3 \, a b^{4} + b^{5}\right )} d \cosh \left (d x + c\right ) \sinh \left (d x + c\right )^{3} + {\left (a^{3} b^{2} + 3 \, a^{2} b^{3} + 3 \, a b^{4} + b^{5}\right )} d \sinh \left (d x + c\right )^{4} + 2 \, {\left (a^{3} b^{2} + a^{2} b^{3} - a b^{4} - b^{5}\right )} d \cosh \left (d x + c\right )^{2} + 2 \, {\left (3 \, {\left (a^{3} b^{2} + 3 \, a^{2} b^{3} + 3 \, a b^{4} + b^{5}\right )} d \cosh \left (d x + c\right )^{2} + {\left (a^{3} b^{2} + a^{2} b^{3} - a b^{4} - b^{5}\right )} d\right )} \sinh \left (d x + c\right )^{2} + {\left (a^{3} b^{2} + 3 \, a^{2} b^{3} + 3 \, a b^{4} + b^{5}\right )} d + 4 \, {\left ({\left (a^{3} b^{2} + 3 \, a^{2} b^{3} + 3 \, a b^{4} + b^{5}\right )} d \cosh \left (d x + c\right )^{3} + {\left (a^{3} b^{2} + a^{2} b^{3} - a b^{4} - b^{5}\right )} d \cosh \left (d x + c\right )\right )} \sinh \left (d x + c\right )\right )}} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [F(-2)]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \text {Exception raised: SystemError} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [B] Leaf count of result is larger than twice the leaf count of optimal. 194 vs.
\(2 (79) = 158\).
time = 0.53, size = 194, normalized size = 2.34 \begin {gather*} -\frac {\frac {{\left (a^{2} + 2 \, a b\right )} \log \left (a e^{\left (4 \, d x + 4 \, c\right )} + b e^{\left (4 \, d x + 4 \, c\right )} + 2 \, a e^{\left (2 \, d x + 2 \, c\right )} - 2 \, b e^{\left (2 \, d x + 2 \, c\right )} + a + b\right )}{a^{2} b^{2} + 2 \, a b^{3} + b^{4}} + \frac {2 \, {\left (d x + c\right )}}{a^{2} + 2 \, a b + b^{2}} + \frac {4 \, a^{2} e^{\left (2 \, d x + 2 \, c\right )}}{{\left (a e^{\left (4 \, d x + 4 \, c\right )} + b e^{\left (4 \, d x + 4 \, c\right )} + 2 \, a e^{\left (2 \, d x + 2 \, c\right )} - 2 \, b e^{\left (2 \, d x + 2 \, c\right )} + a + b\right )} {\left (a + b\right )}^{2} b} - \frac {2 \, \log \left (e^{\left (2 \, d x + 2 \, c\right )} + 1\right )}{b^{2}}}{2 \, d} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Mupad [B]
time = 1.61, size = 170, normalized size = 2.05 \begin {gather*} -\frac {a^2}{2\,\left (d\,a^2\,b^2+d\,a\,b^3\,{\mathrm {tanh}\left (c+d\,x\right )}^2+d\,a\,b^3+d\,b^4\,{\mathrm {tanh}\left (c+d\,x\right )}^2\right )}-\frac {\ln \left ({\mathrm {tanh}\left (c+d\,x\right )}^2-1\right )}{2\,\left (d\,a^2+2\,d\,a\,b+d\,b^2\right )}-\frac {a^2\,\ln \left (b\,{\mathrm {tanh}\left (c+d\,x\right )}^2+a\right )}{2\,\left (d\,a^2\,b^2+2\,d\,a\,b^3+d\,b^4\right )}-\frac {a\,b\,\ln \left (b\,{\mathrm {tanh}\left (c+d\,x\right )}^2+a\right )}{d\,a^2\,b^2+2\,d\,a\,b^3+d\,b^4} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________